package queries;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;

import entitys.Category;

public class GetSales {

	public static ArrayList<String> exe(Connection conn) {
		ArrayList<String> arr = new ArrayList<String>();
		ResultSet res = null; 
		Statement stmt;
		int index = 0;	
			try {
				stmt = conn.createStatement();
				res = stmt.executeQuery("SELECT * from ccrm.marketingsales; ");
				
				while(res.next())
				{
					arr.add(new String(res.getInt(1)+"@"+res.getInt(3)));
				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				System.out.println("Error in retrieving categories");
			}
			try {
				res.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		return arr;
		
	}
	
}
